/*
 * *
 *  * Copyright (c) iwindplus Technologies Co., Ltd.2024-2030, All rights reserved.
 *
 *
 */

package com.iwindplus.mgt.api.system;

import com.iwindplus.boot.domain.validation.SaveGroup;
import com.iwindplus.boot.domain.vo.ResultVO;
import com.iwindplus.mgt.domain.dto.system.ServerSaveEditBatchDTO;
import com.iwindplus.mgt.domain.vo.system.ServerRouteDefinitionVO;
import io.swagger.v3.oas.annotations.Operation;
import java.util.List;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 服务相关接口.
 *
 * @author zengdegui
 * @since 2020年4月1日
 */
public interface ServerApi {

    /**
     * API前缀.
     */
    String API_PREFIX = "inner/server/";

    /**
     * 批量添加或编辑.
     *
     * @param entity 对象
     * @return ResultVO<Boolean>
     */
    @Operation(summary = "批量添加或编辑")
    @PostMapping(API_PREFIX + "saveOrEditBatch")
    ResultVO<Boolean> saveOrEditBatch(@RequestBody @Validated({SaveGroup.class}) ServerSaveEditBatchDTO entity);

    /**
     * 所有服务路由.
     *
     * @return ResultVO<List < ServerRouteDefinitionVO>>
     */
    @Operation(summary = "所有服务路由")
    @GetMapping(API_PREFIX + "listRouteDefinition")
    ResultVO<List<ServerRouteDefinitionVO>> listRouteDefinition();
}
